using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using QuanLyThietBi.Config;     
using QuanLyThietBi.Entity;
namespace QuanLyThietBi.ManagerBase
{
                

     public abstract class TBL_PhongBanManagerBase
    {
        public TBL_PhongBanManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity Insert(TBL_PhongBanEntity obj)
        { 
            return (TBL_PhongBanEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity Update(TBL_PhongBanEntity obj)
        { 
            return (TBL_PhongBanEntity)Adapter.Update(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo dieu kien trong object
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity UpdateWithCondition(TBL_PhongBanEntity obj,TBL_PhongBanEntity objCond)
        { 
            return (TBL_PhongBanEntity)Adapter.UpdateWithCondition(obj,objCond);             
        }
 
 
        public TBL_PhongBanEntity Delete(TBL_PhongBanEntity obj)
        { 
            return (TBL_PhongBanEntity)Adapter.Delete(obj);             
        }
 
 
        public TBL_PhongBanEntity DeleteWithCondition(TBL_PhongBanEntity objCond)
        { 
            return (TBL_PhongBanEntity)Adapter.DeleteWithCondition(objCond);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity DeleteByMaBoPhan (TBL_PhongBanEntity obj)
        { 
            return (TBL_PhongBanEntity)Adapter.DeleteByField(obj,"MaBoPhan");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaBoPhan 
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity DeleteByMaBoPhan (string MaBoPhan )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return (TBL_PhongBanEntity)Adapter.DeleteByField(obj,"MaBoPhan");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity DeleteByMaPB (TBL_PhongBanEntity obj)
        { 
            return (TBL_PhongBanEntity)Adapter.DeleteByField(obj,"MaPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaPB 
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity DeleteByMaPB (string MaPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaPB = MaPB;  
            return (TBL_PhongBanEntity)Adapter.DeleteByField(obj,"MaPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MotaPB duoc set trong object
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity DeleteByMotaPB (TBL_PhongBanEntity obj)
        { 
            return (TBL_PhongBanEntity)Adapter.DeleteByField(obj,"MotaPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MotaPB 
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity DeleteByMotaPB (string MotaPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MotaPB = MotaPB;  
            return (TBL_PhongBanEntity)Adapter.DeleteByField(obj,"MotaPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenPB duoc set trong object
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity DeleteByTenPB (TBL_PhongBanEntity obj)
        { 
            return (TBL_PhongBanEntity)Adapter.DeleteByField(obj,"TenPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenPB 
        /// </summary>
        /// <returns>TBL_PhongBanEntity</returns>
        public TBL_PhongBanEntity DeleteByTenPB (string TenPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.TenPB = TenPB;  
            return (TBL_PhongBanEntity)Adapter.DeleteByField(obj,"TenPB");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public TBL_PhongBanEntity Select(TBL_PhongBanEntity obj)
        { 
            return (TBL_PhongBanEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_PhongBanEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_PhongBanEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new TBL_PhongBanEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new TBL_PhongBanEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_PhongBanEntity> SelectAllLST()
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_PhongBanEntity()),new TBL_PhongBanEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_PhongBanEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_PhongBanEntity(),option),new TBL_PhongBanEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaBoPhan (TBL_PhongBanEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaBoPhan");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaBoPhan (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaBoPhan",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectByMaBoPhanLST (TBL_PhongBanEntity obj)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaBoPhan"),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectByMaBoPhanLST (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaBoPhan",option),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaBoPhan (string MaBoPhan )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return Adapter.SelectByField(obj,"MaBoPhan");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaBoPhan (string MaBoPhan, SelectOptions option)
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return Adapter.SelectByField(obj,"MaBoPhan",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_PhongBanEntity> SelectByMaBoPhanLST (string MaBoPhan )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaBoPhan"),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaBoPhan duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_PhongBanEntity> SelectByMaBoPhanLST (string MaBoPhan, SelectOptions option)
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaBoPhan = MaBoPhan;  
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaBoPhan",option),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (TBL_PhongBanEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectByMaPBLST (TBL_PhongBanEntity obj)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB"),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectByMaPBLST (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaPB",option),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (string MaPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaPB = MaPB;  
            return Adapter.SelectByField(obj,"MaPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (string MaPB, SelectOptions option)
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaPB = MaPB;  
            return Adapter.SelectByField(obj,"MaPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_PhongBanEntity> SelectByMaPBLST (string MaPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaPB = MaPB;  
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB"),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_PhongBanEntity> SelectByMaPBLST (string MaPB, SelectOptions option)
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MaPB = MaPB;  
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB",option),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MotaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMotaPB (TBL_PhongBanEntity obj)
        { 
            return Adapter.SelectByField(obj,"MotaPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MotaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMotaPB (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MotaPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MotaPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectByMotaPBLST (TBL_PhongBanEntity obj)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MotaPB"),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MotaPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectByMotaPBLST (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MotaPB",option),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MotaPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMotaPB (string MotaPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MotaPB = MotaPB;  
            return Adapter.SelectByField(obj,"MotaPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MotaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMotaPB (string MotaPB, SelectOptions option)
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MotaPB = MotaPB;  
            return Adapter.SelectByField(obj,"MotaPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MotaPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_PhongBanEntity> SelectByMotaPBLST (string MotaPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MotaPB = MotaPB;  
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MotaPB"),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MotaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_PhongBanEntity> SelectByMotaPBLST (string MotaPB, SelectOptions option)
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.MotaPB = MotaPB;  
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MotaPB",option),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenPB (TBL_PhongBanEntity obj)
        { 
            return Adapter.SelectByField(obj,"TenPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenPB (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"TenPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectByTenPBLST (TBL_PhongBanEntity obj)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenPB"),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectByTenPBLST (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"TenPB",option),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenPB (string TenPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.TenPB = TenPB;  
            return Adapter.SelectByField(obj,"TenPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenPB (string TenPB, SelectOptions option)
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.TenPB = TenPB;  
            return Adapter.SelectByField(obj,"TenPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_PhongBanEntity> SelectByTenPBLST (string TenPB )
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.TenPB = TenPB;  
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenPB"),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_PhongBanEntity> SelectByTenPBLST (string TenPB, SelectOptions option)
        { 
            TBL_PhongBanEntity obj = new TBL_PhongBanEntity();
            obj.TenPB = TenPB;  
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenPB",option),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectWithConditionLST (TBL_PhongBanEntity obj)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new TBL_PhongBanEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_PhongBanEntity></returns>
        public List<TBL_PhongBanEntity> SelectWithConditionLST (TBL_PhongBanEntity obj,SelectOptions option)
        { 
            return  (List<TBL_PhongBanEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new TBL_PhongBanEntity());
        }

}
}
